<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" th:href="@{/webjars/layui/css/layui.css}">
</head>
<body>
<form class="layui-form" id="updateForm" th:object="${account}" th:action="@{/account/update}">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
            <input type="hidden" name="accountId" th:value="*{accountId}">
            <input type="text" name="username" placeholder="请输入用户名"
                   autocomplete="off" class="layui-input" lay-verify="required|checkUsername" th:value="*{username}" maxlength="20">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="password" name="password" placeholder="请输入密码"
                   autocomplete="off" class="layui-input" maxlength="20">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名</label>
        <div class="layui-input-block">
            <input type="text" name="realName" placeholder="请输入姓名" th:value="*{realName}"
                   autocomplete="off" class="layui-input" lay-verify="required" maxlength="50">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-block">
            <select name="roleId" lay-verify="required">
                <option value="">--请选择--</option>
                <option value="" th:each="role:${roles}" th:value="${role.roleId}" th:text="${role.roleName}"
                        th:selected="${role.roleId == account.roleId}">
                </option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <input type="radio" name="sex" value="男" title="男" th:checked="*{sex=='男'}">
            <input type="radio" name="sex" value="女" title="女" th:checked="*{sex=='女'}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" name="email" placeholder="请输入邮箱" th:value="*{email}"
                   autocomplete="off" class="layui-input" lay-verify="email" maxlength="100">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="updateSubmit">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
</html>
